package com.gm.commonlib.views.choiceview;

import java.util.HashMap;



public class CustomItemChoosenEntityImpl implements CustomItemChoosenEntity {
    private String content;
    private final HashMap<String, Object> extraInfo = new HashMap<>();

    public CustomItemChoosenEntityImpl(String content) {
        this.content = content;
    }

    public CustomItemChoosenEntityImpl putInfo(String key, Object value) {
        extraInfo.put(key, value);
        return this;
    }

    public Object getInfo(String key) {
        return getInfo(key, null);
    }

    public Object getInfo(String key, Object defValue) {
        Object object = extraInfo.get(key);
        if (object == null) {
            return defValue;
        }
        return object;
    }

    @Override
    public String getText() {
        return content;
    }
}
